<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>cnblogs_api module &mdash; Cnblogs Blogger Downloader  documentation</title>
      <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
    <script src="../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="prev" title="lib" href="modules.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
            <a href="../index.html" class="icon icon-home"> Cnblogs Blogger Downloader
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../main.html">main module</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cnblogs_downloader.html">cnblogs_downloader module</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">lib</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">cnblogs_api module</a></li>
</ul>
</li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">Cnblogs Blogger Downloader</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
          <li><a href="modules.html">lib</a> &raquo;</li>
      <li>cnblogs_api module</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/lib/cnblogs_api.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="module-lib.cnblogs_api">
<span id="cnblogs-api-module"></span><h1>cnblogs_api module<a class="headerlink" href="#module-lib.cnblogs_api" title="Permalink to this headline"></a></h1>
<dl class="py data">
<dt class="sig sig-object py" id="lib.cnblogs_api.TIMEOUT">
<span class="sig-prename descclassname"><span class="pre">lib.cnblogs_api.</span></span><span class="sig-name descname"><span class="pre">TIMEOUT</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">5</span></em><a class="headerlink" href="#lib.cnblogs_api.TIMEOUT" title="Permalink to this definition"></a></dt>
<dd><p>HTTP连接超时时间</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="lib.cnblogs_api.get_category_list">
<span class="sig-prename descclassname"><span class="pre">lib.cnblogs_api.</span></span><span class="sig-name descname"><span class="pre">get_category_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">http_header</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/lib/cnblogs_api.html#get_category_list"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#lib.cnblogs_api.get_category_list" title="Permalink to this definition"></a></dt>
<dd><p>获取用户的博客分类</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>http_header</strong> (<em>dict</em>) – 其中应当包含Cookie</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>dict</p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>详情参见接口文档: <a class="reference external" href="./cnblogs-apiDoc.html">cnblogs-apiDoc.md</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="lib.cnblogs_api.get_post_by_id">
<span class="sig-prename descclassname"><span class="pre">lib.cnblogs_api.</span></span><span class="sig-name descname"><span class="pre">get_post_by_id</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">http_header</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">id</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/lib/cnblogs_api.html#get_post_by_id"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#lib.cnblogs_api.get_post_by_id" title="Permalink to this definition"></a></dt>
<dd><p>获取随笔详情</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>http_header</strong> (<em>dict</em>) – 其中应当包含Cookie</p></li>
<li><p><strong>id</strong> (<em>int</em>) – 从`get_posts_list`结果中随笔对应的id</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>dict</p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><p>详情参见接口文档: <a class="reference external" href="./cnblogs-apiDoc.html">cnblogs-apiDoc.md</a></p>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="lib.cnblogs_api.get_posts_list">
<span class="sig-prename descclassname"><span class="pre">lib.cnblogs_api.</span></span><span class="sig-name descname"><span class="pre">get_posts_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">http_header</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category_id</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/lib/cnblogs_api.html#get_posts_list"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#lib.cnblogs_api.get_posts_list" title="Permalink to this definition"></a></dt>
<dd><p>分页获取随笔列表，并把他们拼接成一页返回</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>http_header</strong> (<em>dict</em>) – 其中应当包含Cookie</p></li>
<li><p><strong>category_id</strong> (<em>int</em>) – get_category_list结果中分类对应的id，不设置时查询所有随笔</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>dict</p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><p>详情参见接口文档: <a class="reference external" href="./cnblogs-apiDoc.html">cnblogs-apiDoc.md</a></p>
</p>
</dd>
</dl>
</dd></dl>

</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="modules.html" class="btn btn-neutral float-left" title="lib" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2022, Charles.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>